/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __F1C40C2D_E7DE_41EE_B87B_783BB9D47D10__
#define __F1C40C2D_E7DE_41EE_B87B_783BB9D47D10__

namespace net
{

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    // 
    // i_connect
    // 
    class i_connect : public xos::i_release
    {
    protected:
        virtual ~i_connect() {}

    public:
        virtual int set_user_data( void * pUserData ) = 0;
        virtual void * get_user_data() = 0;

        virtual int release_ref() = 0;
        virtual int add_ref() = 0;

        virtual const char * local_ip() = 0;
        virtual const char * peer_ip() = 0;

        virtual int local_port() = 0;
        virtual int peer_port() = 0;

        virtual bool is_tcp() = 0;
    };

} // net

#endif // __F1C40C2D_E7DE_41EE_B87B_783BB9D47D10__
